package com.company.myfirstjmixproject.entity.enums;

import javax.annotation.Nullable;


public enum BomTypeEnum {

    MST("MST","主BOM"),
    ALTER("ALTER","替代BOM"),
    HIS("HIS","历史BOM");

    private final String type;

    private final String typeName;

    BomTypeEnum(String type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }

    public String getType() {
        return type;
    }

    public String getTypeName() {
        return typeName;
    }

    @Nullable
    public static BomTypeEnum fromType(String type) {
        for (BomTypeEnum at : BomTypeEnum.values()) {
            if (at.getType().equals(type)) {
                return at;
            }
        }
        return null;
    }
}